function recursiveMonteCarlo = InitrecursiveMonteCarlo(interestRate, ...
    deltat, T, sigma, phi, priceZero)

% Compute the number of steps which will be used to approximate the value of
% dS = (r - \sigma^2 / 2)T + \sigma dW_T by using Backward Euler.
N                       = T / deltat;
% Allocate a vector for the result.
recursiveMonteCarlo     = zeros(1, N);
% Set the initial value to the current stock price.
recursiveMonteCarlo(1)  = priceZero;



for i = 2 : N + 1
   recursiveMonteCarlo(i) = recursiveMonteCarlo(i - 1) + ...
       recursiveMonteCarlo(i - 1) * (interestRate * deltat + sigma * phi(i) ...
			* sqrt(deltat));
end
